Update quiver trace API - #7945
Conversation
847fd88 to
66fd95f
Compare
66fd95f to
7c9f063
Compare
camdecoster
left a comment
There was a problem hiding this comment.
I left you a few suggestions. I like the new attribute names.
| // TODO: How to handle the case where there is just one point in a trace, | ||
| // or all points have the same x or y value? This will give a boxArea of 0. | ||
| // For now I'm going to just normalize to a vector of unit length (1) in that case, | ||
| // but that's not a great solution |
There was a problem hiding this comment.
Can this comment be addressed?
There was a problem hiding this comment.
Addressed by 1315d07. I updated the point distance calculation to be more accurate, and as a bonus now it covers the case where all the points are in a horizontal or vertical line.
There's nothing we can do about the case where all points have the same x or y value; I think it's reasonable to just default to 1 in that case.
Co-authored-by: Cameron DeCoster <cameron.decoster@gmail.com>
b46f29c to
1507db6
Compare
… case where all points are in a horizontal or vertical line
1507db6 to
1315d07
Compare
camdecoster
left a comment
There was a problem hiding this comment.
arrowref is also a good choice.
| * D = (dX + dY + sqrt((dX - dY)^2 + 4N * dX * dY)) / (2 * (N - 1)) | ||
| * which is the forumla we'll use below. | ||
| * | ||
| * Note: this formula was derived and documented by a human ;) |
Glad you're OK with it. It occurred to me that in the future we may want to add the option to specify vectors by angle and magnitude, rather than |
Closes #7944
Also:
arrowref(was'axis'which is not an accepted value; changed to'data')lengthmode: 'scaled'arrow length calculation